package com.ztesoft.book.core.sys.sysrole.service.impl;

import com.ztesoft.book.core.base.base.service.impl.BaseExServiceImpl;
import com.ztesoft.book.core.sys.sysrole.dto.SysRoleDTO;
import com.ztesoft.book.core.sys.sysrole.mapper.SysRoleMapper;
import com.ztesoft.book.core.sys.sysrole.qo.SysRoleQO;
import com.ztesoft.book.core.sys.sysrole.service.SysRoleService;
import com.ztesoft.book.core.sys.sysuser.dto.SysUserDTO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description 角色
 * @Author YangFan
 * @Date 2021-06-22 17:32
 */
@Service("sysRoleService")
public class SysRoleServiceImpl extends BaseExServiceImpl<SysRoleMapper, SysRoleDTO, SysRoleQO> implements SysRoleService {


    @Resource
    private SysRoleMapper sysRoleMapper;

    /**
     * 获取权限内列表
     *
     * @param roleIdList
     * @return
     */
    @Override
    public List<SysRoleDTO> getMyList(List<String> roleIdList) {

        List<SysRoleDTO> list = this.getMapper().getMyList(roleIdList);
        return list;
    }


    @Override
    protected SysRoleMapper getMapper() {
        return sysRoleMapper;
    }


    @Override
    public List<SysRoleDTO> findList(SysRoleQO qo) {
        SysUserDTO loginUser = getShiroUser();
        return super.findList(qo);
    }

    @Override
    protected void beforeAdding(SysRoleDTO sysRoleDTO) {
        SysUserDTO shiroUser = getShiroUser();
        super.beforeAdding(sysRoleDTO);
    }
}
